﻿@model SDSystem.Models.Programme
@using Ext.Net;
@using Ext.Net.MVC;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@*@(Html.X().Panel()
                    .ItemID("north")
                    .Height(25)
                    .Header(false)
                    .Border(false)
                    

      )*@

@(Html.X().TabPanel()
      .Region(Region.Center)
      .MarginSpec("0 0 0 0")
      .Items(
          Html.X().FormPanel()
              .ID("FormPanel1")
              .Title("Details")
              .BodyPadding(10)
              .Layout(LayoutType.Form)
              .Items(
                  Html.X().FieldContainer().Layout(LayoutType.HBox).Items(
                      Html.X().TextFieldFor(m => m.ProgrammeName).EmptyText("New Programme Name Test").Flex(2).Margins("0 10 10 5").FieldLabel("Programme Name <font color=\"red\">*</font>").LabelWidth(200).MsgTarget(MessageTarget.Side	),
                      Html.X().TextField().ID("ContactLookup").Flex(1).Margins("0 10 10 5").FieldLabel("Contact").LabelWidth(200).AllowBlank(false).MsgTarget(MessageTarget.Side),
                      Html.X().HiddenFor(m => m.ContactId).ID("hIdLookup"),
                      Html.X().LinkButton().Text("Lookup").Listeners(
                          li => li.Click.Handler = "showWindow('Lookup','/Contact/List/?text=ContactLookup&id=hIdLookup',true,0.85,0.85);")
                      ),
                  Html.X().FieldContainer().Layout(LayoutType.HBox).Items(
                      Html.X().TextAreaFor(m => m.Description).Rows(3).EmptyText("New Test Programme Description Test").Flex(1).Margins("0 10 10 5").FieldLabel("Description").LabelWidth(200)
                      )
              )
              .TopBar(Html.X().Toolbar().Items(items =>
                                                   {
                                                       items.Add(new ToolbarTextItem {Text = "<h3 style=\"color:green\">Programme Details</h3>"});

                                                       items.Add(new ToolbarFill());
                                                   })
                          .Items(
                              Html.X().Button().Text("<b>Deactive</b>").Icon(Icon.StopRed).Margins("0 20 0 0"),
                              Html.X().Button().ID("btnSave").Text("<b>Save</b>").Margins("0 20 0 0").Icon(Icon.ScriptSave).DirectEvents(de =>
                                                                                                                                             {
                                                                                                                                                 de.Click.Url = Url.Action("Save");
                                                                                                                                                 de.Click.EventMask.ShowMask = true;
                                                                                                                                                 de.Click.FormID = "FormPanel1";
                                                                                                                                             }),
                              Html.X().Button().Text("<b>Back</b>").Icon(Icon.PageBack).Margins("0 20 0 0")
                                                            
                          )

              )
      ))

                
